<p>Method/constructor references are more compact and readable than using lambdas, and are therefore preferred. Similarly, <code>null</code> checks
can be replaced with references to the <code>Objects::isNull</code> and <code>Objects::nonNull</code> methods.</p>
<p><strong>Note</strong> that this rule is automatically disabled when the project's <code>sonar.java.source</code> is lower than <code>8</code>.</p>
<h2>Noncompliant Code Example</h2>
<pre>
class A {
  void process(List&lt;A&gt; list) {
    list.stream()
      .map(a -&gt; a.&lt;String&gt;getObject())
      .forEach(a -&gt; { System.out.println(a); });
  }

  &lt;T&gt; T getObject() {
    return null;
  }
}
</pre>
<h2>Compliant Solution</h2>
<pre>
class A {
  void process(List&lt;A&gt; list) {
    list.stream()
      .map(A::&lt;String&gt;getObject)
      .forEach(System.out::println);
  }

  &lt;T&gt; T getObject() {
    return null;
  }
}
</pre>

